package com.yuntai.pms.model.vo;

import java.io.Serializable;

/**
 * @ClassName: ResultVo
 * @Description: 页面响应结果
 * @author 王勇琳
 * @date 2017年7月21日 下午2:36:42
 */
public class ResultVo implements Serializable {
	private static final long serialVersionUID = 4114068182654429227L;
	
	/** 是否正确 */
	private boolean result;
    /** 正确的响应消息 */
    private String  message;
    /** 正确响应时的业务数据 */
    private Object  content;
    /** 错误响应编码 */
    private String  code;
    /** 错误消息 */
    private String  errorMessage;

    public ResultVo() {
    	this.result = true;
    }
    
    public static ResultVo createSuccessResult(String message) {
    	ResultVo vo = new ResultVo();
    	vo.setResult(true);
    	vo.setMessage(message);
        return vo;
    }
    
    public static ResultVo createSuccessResultWithBizContent(String message, Object bizContent) {
    	ResultVo vo = new ResultVo();
    	vo.setResult(true);
    	vo.setMessage(message);
    	vo.setContent(bizContent);
        return vo;
    }
    
    public static ResultVo createErrorResult(String errorMessage) {
    	ResultVo vo = new ResultVo();
    	vo.setResult(false);
    	vo.setErrorMessage(errorMessage);
        return vo;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getContent() {
        return content;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public void setContent(Object content) {
        this.content = content;
    }

}
